import Vue from 'vue'
import App from './App'
import router from './router' //自动扫描里面的路由配置信息
import ElementUI from 'element-ui'
import axios from 'axios'
import Qs from 'qs'
import VueCookies from 'vue-cookies'
import md5 from 'js-md5'

import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/global.css'
import './assets/fonts/login/iconfont.css'
import './assets/fonts/home/iconfont.css'
import './assets/fonts/sex/iconfont.css'
import './assets/fonts/sex/iconfont.js'

Vue.use(ElementUI);

axios.defaults.headers['Content-Type'] = 'application/json';
//axios请求拦截添加token
axios.interceptors.request.use(config => {
    //将token添加到请求头
    config.headers.Authorization = window.sessionStorage.getItem("token");
    return config; //最后必须return config
});

//服务器地址
Vue.prototype.$http = 'http://localhost:8909';

Vue.prototype.$axios = axios;
Vue.prototype.$qs = Qs;
Vue.prototype.$cookies = VueCookies;
Vue.prototype.$md5 = md5;
Vue.prototype.$confirm = ElementUI.MessageBox.confirm;
Vue.config.productionTip = false;



new Vue({
  el: '#app',
  //配置路由
  router,
  components: { App },
  template: '<App/>',
});
